<?php

namespace App\Models\Activity;

use App\Models\BaseModel;
use App\Models\Kms\User\KmsUser;
use App\Models\Shop\ShopModel;
use App\Models\Traits\KfSoftDeletes;
use App\Models\Traits\KfUid;
use Illuminate\Database\Eloquent\Relations\HasOne;

class ShopOrderActivityFeedbackModel extends BaseModel
{
    use KfUid;
    use KfSoftDeletes;

    protected $table = 'shop_order_activity_feedback';

    protected $fillable = [
        'activityId',
        'shopId',
        'shopName',
        'shopContact',
        'feedback',
        'feedbackImages',
        'feedbackVideos',
        'createdAt',
        'createdByUid',
        'updatedAt',
        'updatedByUid',
        'isDeleted',
    ];

    protected $casts = [
        'createdAt' => 'datetime:Y-m-d H:i:s',
        'updatedAt' => 'datetime:Y-m-d H:i:s',
        'feedbackImages' => 'array',
        'feedbackVideos' => 'array',
    ];


    /**
     * @return HasOne
     */
    public function shopDetailRel(): HasOne
    {
        return $this->hasOne(ShopModel::class, "id", "shopId");
    }

    /**
     * @return HasOne
     */
    public function createdUserRel(): HasOne
    {
        return $this->hasOne(KmsUser::class, "rmsUserId", "createdByUid");
    }

}
